import Vue from 'vue'
import tipsBox from './index.vue'
let tipsConstructors = Vue.extend(tipsBox)

function createInstance(text, duration = 2000) {
    let tipsInstance = new tipsConstructors({
        el: document.createElement('div'),
        data() {
            return {
                text: text,
                show: true
            };
        },
    })
    document.body.appendChild(tipsInstance.$el)
    setTimeout(() => {
        tipsInstance.show = false
    }, duration)
}
export default function mountedInstance() {
    Vue.prototype.$tips = createInstance
}